#ifndef WIFI_LOWLEVEL_H
#define WIFI_LOWLEVEL_H

/* Includes ------------------------------------------------------------------*/
#include "stm32f10x.h"
#include "wifi.h"
#include "delay.h"

/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/  
#define WIFI_UART				USART2
#define WIFI_UART_CLK			RCC_APB1Periph_USART2
#define WIFI_UART_CLK_INIT		RCC_APB1PeriphClockCmd
#define WIFI_UART_IRQn			USART2_IRQn
#define WIFI_UART_IRQHandler	USART2_IRQHandler

#define WIFI_TX_PIN				GPIO_Pin_2
#define WIFI_TX_PORT			GPIOA
#define WIFI_TX_CLK				RCC_APB2Periph_GPIOA

#define WIFI_RX_PIN				GPIO_Pin_3
#define WIFI_RX_PORT			GPIOA
#define WIFI_RX_CLK				RCC_APB2Periph_GPIOA

#define WIFI_EN_PIN				GPIO_Pin_8
#define WIFI_EN_PORT			GPIOA
#define WIFI_EN_CLK				RCC_APB2Periph_GPIOA

#define WIFI_RST_PIN			GPIO_Pin_8
#define WIFI_RST_PORT			GPIOC
#define WIFI_RST_CLK			RCC_APB2Periph_GPIOC

/* Exported macro ------------------------------------------------------------*/
/* Exported variables ---------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void WiFi_LowLevel_Init(void);
void WiFi_Setup(char *atcmd);
void WiFi_Send(void *dat, int len);
void WiFi_Enable(void);
void WiFi_Disable(void);
void WiFi_Reset(void);

#endif
